package edu.cuit.avatar.dao.bean;

import edu.cuit.avatar.dao.OrderDao;
import edu.cuit.avatar.po.Order;
import jakarta.annotation.Resource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/8/14 10:23
 */
@Repository
public class OrderDaoBean implements OrderDao {
    @Resource private JdbcTemplate template;
    @Override
    public void insert(Order order) {
        var sql = "insert into tb_order(id,amount,user_id) values(?,?,?)";
        template.update(sql, order.getId(), order.getAmount(), order.getUserId());
    }
}
